Skip to content

Hoist the GitHub stats into one shared constant - #134

Merged
guanzhousongmicrosoft merged 1 commit into
documentdb:mainfrom
GuanzhouSong:shared-github-stats
Aug 3, 2026
Merged

Hoist the GitHub stats into one shared constant#134
guanzhousongmicrosoft merged 1 commit into
documentdb:mainfrom
GuanzhouSong:shared-github-stats

Conversation

@GuanzhouSong

Copy link
Copy Markdown
Contributor

Addresses the second half of #128 (the GitHub stats). The create_indexes_background row in the first half is content in documentdb/docs and needs a separate PR there — see the note at the bottom.

Problem

The star and fork counts were hardcoded independently in two files with no shared constant, so they drifted apart:

Metric app/page.tsx app/ai/page.tsx Actual
Stars 3.2k+ 3.4k+ 3423
Forks 200+ 240+ 248
$ curl -s https://api.github.com/repos/documentdb/documentdb | jq "{stars: .stargazers_count, forks: .forks_count}"
{ "stars": 3423, "forks": 248 }

Both render in adjacent sections — "Built in the open" on / and "Built in the open, backed by a real ecosystem" on /ai — so a visitor moving between the two pages sees two different star counts for the same repository.

Worth being precise about severity: neither figure is false. The + suffix covers the actual numbers in both cases. The defect is that nothing stopped a refresh from updating one page and leaving the other behind, which is exactly what happened when #121 refreshed the AI page.

Fix

Both pages now read from app/services/projectStats.ts. The TSC member and organization counts are hoisted too — they are quoted on both pages and currently agree, so this keeps them from being the next thing to drift. They were verified against upstream MAINTAINERS.md: 11 members across Microsoft (4), Amazon (4), AB InBev (1), Rippling (1), YugabyteDB (1).

Values stay hardcoded rather than fetched at build time, so the build keeps no network dependency on a rate-limited unauthenticated API. The refresh command and the date last checked are recorded in the file so the next update is a one-line change in one place.

No rendered output changes on /ai; / picks up the newer figures.

Not in this PR

§1 of the issue — the create_index_background table row being wrong in name, schema, and description — lives in postgres-api/functions.md in documentdb/docs. articles/ is a gitignored build artifact here, cloned at build time per content.config.json, so the fix cannot land in this repo. I confirmed the upstream definition while validating: create_index_background--0.111-0.sql defines create_indexes_background (plural) under __API_SCHEMA_V2__, which Makefile:28 resolves to documentdb_api, not documentdb_api_internal. Happy to open that PR next.

npm is blocked on this machine, so lint and the build are left to CI. The change is a constant extraction with no logic.

The star and fork counts were hardcoded independently in app/page.tsx
and app/ai/page.tsx with no shared constant, so they drifted: the
homepage said 3.2k+ stars and 200+ forks while /ai said 3.4k+ and 240+.
Both sections render adjacent copy about the project being built in the
open, so a visitor moving between the two pages saw two different star
counts.

Neither figure was false - the + suffix covers the actual 3423 stars and
248 forks - but nothing stopped the next refresh from updating one page
and leaving the other behind, which is exactly what happened when the AI
page was refreshed in documentdb#121.

Both pages now read from app/services/projectStats.ts, which also holds
the TSC member and organization counts quoted on both pages (verified
against upstream MAINTAINERS.md: 11 members across Microsoft 4, Amazon 4,
AB InBev 1, Rippling 1, YugabyteDB 1). Values stay hardcoded rather than
fetched so the build keeps no network dependency; the refresh command and
the date last checked are recorded next to them.

Addresses the second half of documentdb#128. The create_indexes_background row in
the first half is content in documentdb/docs and needs a separate PR
there.
@guanzhousongmicrosoft
guanzhousongmicrosoft merged commit c29cb76 into documentdb:main Aug 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants